<?php
/**
 * Created by PhpStorm.
 * User: yzapple
 * Date: 2018/1/18
 * Time: 上午11:13
 */

namespace app\common\validate;


use think\Validate;

class Doctor extends Validate
{

    protected $rule =   [
        'username'  => 'require|unique:doctor',
        'name'  => 'require',
    ];

    protected $message  =   [
        'username.require' => '用户id',
        'username.unique'   => '用户ID已存在',
        'name.require'   => '姓名',
    ];


    //场景不同场景验证不同的字段
    protected $scene = [
        'add_doctor'    => ['username','name','password'],
        'edit_doctor' => [''],
    ];

}